package FileTransferIRPSystem;


/**
 * Generated from IDL interface "FileTransferIRP".
 *
 * @author JacORB IDL compiler V 2.3.0, 17-Feb-2007
 * @version generated at 2013-5-20 22:07:19
 */

public class _FileTransferIRPStub
	extends org.omg.CORBA.portable.ObjectImpl
	implements FileTransferIRPSystem.FileTransferIRP
{
	private String[] ids = {"IDL:FileTransferIRPSystem/FileTransferIRP:1.0"};
	public String[] _ids()
	{
		return ids;
	}

	public final static java.lang.Class _opsClass = FileTransferIRPSystem.FileTransferIRPOperations.class;
	public java.lang.String[] get_file_transfer_irp_versions() throws FileTransferIRPSystem.GetFileTransferIRPVersions
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "get_file_transfer_irp_versions", true);
				_is = _invoke(_os);
				java.lang.String[] _result = ManagedGenericIRPConstDefs.VersionNumberSetHelper.read(_is);
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:FileTransferIRPSystem/GetFileTransferIRPVersions:1.0"))
				{
					throw FileTransferIRPSystem.GetFileTransferIRPVersionsHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "get_file_transfer_irp_versions", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			FileTransferIRPOperations _localServant = (FileTransferIRPOperations)_so.servant;
			java.lang.String[] _result;
			try
			{
				_result = _localServant.get_file_transfer_irp_versions();
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public ManagedGenericIRPConstDefs.Method[] get_file_transfer_irp_notifications_profile(java.lang.String irp_version) throws FileTransferIRPSystem.GetFileTransferIRPNotificationsProfile,ManagedGenericIRPSystem.InvalidParameter,ManagedGenericIRPSystem.OperationNotSupported
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "get_file_transfer_irp_notifications_profile", true);
				_os.write_string(irp_version);
				_is = _invoke(_os);
				ManagedGenericIRPConstDefs.Method[] _result = ManagedGenericIRPConstDefs.MethodListHelper.read(_is);
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:FileTransferIRPSystem/GetFileTransferIRPNotificationsProfile:1.0"))
				{
					throw FileTransferIRPSystem.GetFileTransferIRPNotificationsProfileHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:ManagedGenericIRPSystem/InvalidParameter:1.0"))
				{
					throw ManagedGenericIRPSystem.InvalidParameterHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:ManagedGenericIRPSystem/OperationNotSupported:1.0"))
				{
					throw ManagedGenericIRPSystem.OperationNotSupportedHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "get_file_transfer_irp_notifications_profile", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			FileTransferIRPOperations _localServant = (FileTransferIRPOperations)_so.servant;
			ManagedGenericIRPConstDefs.Method[] _result;
			try
			{
				_result = _localServant.get_file_transfer_irp_notifications_profile(irp_version);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public FileTransferIRPConstDefs.Result file_download_indication(FileTransferIRPConstDefs.FileInfo[] file_info_list) throws FileTransferIRPSystem.FileDownloadIndication,ManagedGenericIRPSystem.OperationNotSupported,FileTransferIRPSystem.InvalidFileInfoList
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "file_download_indication", true);
				FileTransferIRPConstDefs.FileInfoListHelper.write(_os,file_info_list);
				_is = _invoke(_os);
				FileTransferIRPConstDefs.Result _result = FileTransferIRPConstDefs.ResultHelper.read(_is);
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:FileTransferIRPSystem/FileDownloadIndication:1.0"))
				{
					throw FileTransferIRPSystem.FileDownloadIndicationHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:ManagedGenericIRPSystem/OperationNotSupported:1.0"))
				{
					throw ManagedGenericIRPSystem.OperationNotSupportedHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:FileTransferIRPSystem/InvalidFileInfoList:1.0"))
				{
					throw FileTransferIRPSystem.InvalidFileInfoListHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "file_download_indication", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			FileTransferIRPOperations _localServant = (FileTransferIRPOperations)_so.servant;
			FileTransferIRPConstDefs.Result _result;
			try
			{
				_result = _localServant.file_download_indication(file_info_list);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public ManagedGenericIRPConstDefs.Method[] get_file_transfer_irp_operations_profile(java.lang.String iRPVersion) throws FileTransferIRPSystem.GetFileTransferIRPOperationsProfile,ManagedGenericIRPSystem.InvalidParameter,ManagedGenericIRPSystem.OperationNotSupported
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "get_file_transfer_irp_operations_profile", true);
				_os.write_string(iRPVersion);
				_is = _invoke(_os);
				ManagedGenericIRPConstDefs.Method[] _result = ManagedGenericIRPConstDefs.MethodListHelper.read(_is);
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:FileTransferIRPSystem/GetFileTransferIRPOperationsProfile:1.0"))
				{
					throw FileTransferIRPSystem.GetFileTransferIRPOperationsProfileHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:ManagedGenericIRPSystem/InvalidParameter:1.0"))
				{
					throw ManagedGenericIRPSystem.InvalidParameterHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:ManagedGenericIRPSystem/OperationNotSupported:1.0"))
				{
					throw ManagedGenericIRPSystem.OperationNotSupportedHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "get_file_transfer_irp_operations_profile", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			FileTransferIRPOperations _localServant = (FileTransferIRPOperations)_so.servant;
			ManagedGenericIRPConstDefs.Method[] _result;
			try
			{
				_result = _localServant.get_file_transfer_irp_operations_profile(iRPVersion);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public FileTransferIRPConstDefs.Result list_available_files(short management_data_type, TimeBase.UtcT begin_time, TimeBase.UtcT end_time, FileTransferIRPConstDefs.FileInfoListHolder file_info_list) throws ManagedGenericIRPSystem.InvalidParameter,FileTransferIRPSystem.ListAvailableFiles,FileTransferIRPSystem.InvalidTimes
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "list_available_files", true);
				_os.write_short(management_data_type);
				TimeBase.UtcTHelper.write(_os,begin_time);
				TimeBase.UtcTHelper.write(_os,end_time);
				_is = _invoke(_os);
				FileTransferIRPConstDefs.Result _result = FileTransferIRPConstDefs.ResultHelper.read(_is);
				file_info_list.value = FileTransferIRPConstDefs.FileInfoListHelper.read(_is);
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:ManagedGenericIRPSystem/InvalidParameter:1.0"))
				{
					throw ManagedGenericIRPSystem.InvalidParameterHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:FileTransferIRPSystem/ListAvailableFiles:1.0"))
				{
					throw FileTransferIRPSystem.ListAvailableFilesHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:FileTransferIRPSystem/InvalidTimes:1.0"))
				{
					throw FileTransferIRPSystem.InvalidTimesHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "list_available_files", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			FileTransferIRPOperations _localServant = (FileTransferIRPOperations)_so.servant;
			FileTransferIRPConstDefs.Result _result;
			try
			{
				_result = _localServant.list_available_files(management_data_type,begin_time,end_time,file_info_list);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

}
